//
//  WUPageTeachCell.m
//  Home
//
//  Created by 吴军虎吴军虎 on 16/5/6.
//  Copyright © 2016年 LanJue. All rights reserved.
//

#import "WUPageTeachCell.h"

@interface WUPageTeachCell()

@property (nonatomic,retain)UILabel *nameL;
@property (nonatomic,retain)UILabel *nameTL;
@property (nonatomic,retain)UILabel *textL;
@property (nonatomic,retain)UILabel *company;
@property (nonatomic,retain)UILabel *whatL;
@property (nonatomic,retain)UILabel *timel;

@end


@implementation WUPageTeachCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self creatView];
    }
    return self;
}
- (void)creatView{
    _nameL = [UILabel new];
    _nameL.text = @"教育经历";
    _nameL.textColor = GH;
    _nameL.font = [UIFont fontWithName:TFont size:TEXTCONTENTFONT * AUTO_WIDTH];
    [self.contentView addSubview:_nameL];
    [_nameL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(5 * AUTO_HEIGHT);
        make.height.mas_equalTo(70/2 * AUTO_HEIGHT);
        make.left.mas_equalTo(15 * AUTO_WIDTH);
        
    }];
    
    UIImageView *image = [UIImageView new];
    [self.contentView addSubview:image];
    image.image = [UIImage imageNamed:@"xueli"];
    [image mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_nameL).offset(4 *AUTO_HEIGHT);
        make.right.mas_equalTo(self).offset(- 15 * AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(25 * AUTO_WIDTH, 25* AUTO_HEIGHT));
 
    }];

    UIImageView *li = [UIImageView new];
    [self.contentView addSubview:li];
    [li mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_nameL.mas_bottom).offset(0/2 * AUTO_HEIGHT);
        make.left.mas_equalTo(1 * AUTO_WIDTH);
        make.height.mas_equalTo(1.5 * AUTO_HEIGHT);
        make.right.mas_equalTo(- 1 * AUTO_WIDTH);
        
    }];
    li.image = [UIImage imageNamed:@"虚线"];

    _nameTL = [UILabel new];
    [self.contentView addSubview:_nameTL];
    _nameTL.text = @"哈佛";
    _nameTL.textColor = ZI;
    _nameTL.font = [UIFont fontWithName:TFont size:TEXTCONTENTFONT * AUTO_WIDTH];
    
    [_nameTL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_nameL.mas_bottom).offset(10 * AUTO_HEIGHT);
        make.height.mas_equalTo(20 * AUTO_HEIGHT);
        // make.left.mas_equalTo(line.mas_right).offset(10 * AUTO_WIDTH);
        make.left.mas_equalTo(_nameL);
        
    }];
    
    _timel = [UILabel new];
    [self addSubview:_timel];
    _timel.text = @"2011-2016";
    _timel.textColor = ZI;
    _timel.font = [UIFont fontWithName:TFont size:TEXTALITTLEFONT * AUTO_WIDTH];
    [_timel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(_nameL.mas_bottom).offset(10 * AUTO_HEIGHT);
        make.height.mas_equalTo(15 * AUTO_HEIGHT);
        make.right.mas_equalTo (self).offset(-20 * AUTO_WIDTH);
        
    }];
    
    _whatL = [UILabel new];
    _whatL.text = @"设计";
    _whatL.textColor = ZI;
    _whatL.font = [UIFont fontWithName:TFont size:TEXTCONTENTFONT * AUTO_WIDTH];
    [self.contentView addSubview:_whatL];
    [_whatL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_nameTL.mas_bottom).offset(10 * AUTO_HEIGHT);
        make.height.mas_equalTo(20 * AUTO_HEIGHT);
        // make.left.mas_equalTo(line.mas_right).offset(10 * AUTO_WIDTH);
        make.left.mas_equalTo(_nameL);
        
        
    }];
    
    
    
    
    UIView *line = [UIView new];
    line.backgroundColor = ZI;
    [self.contentView addSubview:line];
    [line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_whatL).offset(3 * AUTO_HEIGHT);
        make.left.mas_equalTo(_whatL.mas_right).offset(10 * AUTO_WIDTH);
        make.width.mas_equalTo(1.5 * AUTO_WIDTH);
        make.height.mas_equalTo(16 * AUTO_HEIGHT);
        
    }];
    
    
    
    
    
    _textL = [UILabel new];
    _textL.text = @"硕士";
    _textL.font =  [UIFont fontWithName:TFont size:TEXTCONTENTFONT * AUTO_WIDTH];
    _textL.textAlignment = NSTextAlignmentCenter;
    _textL.layer.cornerRadius = 4 * AUTO_HEIGHT;
    _textL.textColor = ZI;
    [self.contentView addSubview:_textL];
    [_textL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_whatL);
        make.left.mas_equalTo(line.mas_right).offset(10 * AUTO_WIDTH);
        make.height.mas_equalTo(20 * AUTO_HEIGHT);
        //  make.width.mas_equalTo(80 * AUTO_WIDTH);
    }];
    
    
    
    
    
    
    
    
}
-(void)settingRegisnModel:(ResignModel *)moedl{
    NSMutableDictionary *dic = moedl.edu;
    
    _nameTL.text = [dic objectForKey:@"schoolname"];
    NSArray *arr = [[dic objectForKey:@"period"] componentsSeparatedByString:@","];
    NSString * first = arr[0];
    NSString * secend = arr[1];
    NSString * exc = [NSString stringWithFormat:@"%@-%@",first,secend];
    _timel.text = exc;
    _whatL.text = [dic objectForKey:@"profession"];
    _textL.text = [dic objectForKey:@"education"];
    

}



@end
